package com.cyl.XmlDemo.entity;

import java.util.Hashtable;
import java.util.Map;

/**
 * 现存用户操作列表
 * @author tyuio
 *
 */
public class UserList {
	
	//UserList对象
	private static UserList instance = new UserList();
	
	//用户列表
	private Map<String,UserInfo> userList = new Hashtable<String,UserInfo>();
	
	private UserList(){
	}

	public static UserList getInstance(){
		return instance;
	}
	
	public UserInfo getUser(String name){
		return userList.get(name);
	}
	
	public void addUser(String name,UserInfo userInfo){
		userList.put(name, userInfo);
	}
	
	public void delUser(String uid){
		userList.remove(uid);
	}
	
	public boolean contain(String name){
		return userList.containsKey(name);
	}

}
